load("@rules_go//go:def.bzl", "go_binary", "go_library", "go_test")

go_library(
    name = "dedupe-tar_lib",
    srcs = ["main.go"],
    embedsrcs = ["common.txt"],
    importpath = "github.com/pachyderm/pachyderm/v2/src/cmd/dedupe-tar",
    visibility = ["//visibility:private"],
    deps = [
        "//src/internal/errors",
        "//src/internal/log",
        "//src/internal/pctx",
        "@com_github_klauspost_compress//zstd",
        "@org_uber_go_zap//:zap",
    ],
)

go_binary(
    name = "dedupe-tar",
    embed = [":dedupe-tar_lib"],
    visibility = ["//visibility:public"],
)

go_test(
    name = "dedupe-tar_test",
    srcs = ["main_test.go"],
    embed = [":dedupe-tar_lib"],
    deps = [
        "//src/internal/errors",
        "@com_github_google_go_cmp//cmp",
        "@com_github_klauspost_compress//zstd",
    ],
)
